DevJourney

Python/VIT/sem-1/ex-15/2. Recursive Fibonacci/Recursive Fibonacci.py

def fib(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fib(n-1) + fib(n-2)

l = []
for i in range(10):
    l.append(fib(i))
print(l)
View on GitHub